#ifndef __MEM_STATIC_H
#define __MEM_STATIC_H

#include "_config_cpu_.h"
#include "mem_static_dev.h"

// ############################################################
// MAPEAMENTO DOS DIPOSITIVOS AOS SEUS RESPECTIVOS CHIP SELECTS
// ############################################################

// CONFIGURAÇÃO DO BANCO 2 (CS2) Endereço entre 0x98000000 - 0x9bffffff
#if (SRAM_BANK2_USE == SRAM_BANK_USE_COMPACT_FLASH_IDE)
  	#define SRAM_BANK2_CFG		COMPACT_FLASH_IDE_CFG
  	#define SRAM_BANK2_WAITWEN	COMPACT_FLASH_IDE_WAITWEN
 	#define SRAM_BANK2_WAITOEN	COMPACT_FLASH_IDE_WAITOEN
 	#define SRAM_BANK2_WAITRD	COMPACT_FLASH_IDE_WAITRD
 	#define SRAM_BANK2_WAITPAGE	COMPACT_FLASH_IDE_WAITPAGE
 	#define SRAM_BANK2_WAITWR	COMPACT_FLASH_IDE_WAITWR
	#define SRAM_BANK2_WAITTURN	COMPACT_FLASH_IDE_WAITTURN		

#elif (SRAM_BANK2_USE == SRAM_BANK_USE_DISPO_GENERIC_8BITS)
  	#define SRAM_BANK2_CFG		DISPO_GENERIC_8BITS_CFG
  	#define SRAM_BANK2_WAITWEN	DISPO_GENERIC_8BITS_WAITWEN
 	#define SRAM_BANK2_WAITOEN	DISPO_GENERIC_8BITS_WAITOEN
 	#define SRAM_BANK2_WAITRD	DISPO_GENERIC_8BITS_WAITRD
 	#define SRAM_BANK2_WAITPAGE	DISPO_GENERIC_8BITS_WAITPAGE
 	#define SRAM_BANK2_WAITWR	DISPO_GENERIC_8BITS_WAITWR
	#define SRAM_BANK2_WAITTURN	DISPO_GENERIC_8BITS_WAITTURN		

#elif (SRAM_BANK2_USE == SRAM_BANK_USE_DISPO_GENERIC_16BITS)
  	#define SRAM_BANK2_CFG		DISPO_GENERIC_16BITS_CFG
  	#define SRAM_BANK2_WAITWEN	DISPO_GENERIC_16BITS_WAITWEN
 	#define SRAM_BANK2_WAITOEN	DISPO_GENERIC_16BITS_WAITOEN
 	#define SRAM_BANK2_WAITRD	DISPO_GENERIC_16BITS_WAITRD
 	#define SRAM_BANK2_WAITPAGE	DISPO_GENERIC_16BITS_WAITPAGE
 	#define SRAM_BANK2_WAITWR	DISPO_GENERIC_16BITS_WAITWR
	#define SRAM_BANK2_WAITTURN	DISPO_GENERIC_16BITS_WAITTURN		

#elif (SRAM_BANK2_USE == SRAM_BANK_USE_FAST_SRAM_16BITS)
  	#define SRAM_BANK2_CFG		FAST_SRAM_16BITS_CFG
  	#define SRAM_BANK2_WAITWEN	FAST_SRAM_16BITS_WAITWEN
 	#define SRAM_BANK2_WAITOEN	FAST_SRAM_16BITS_WAITOEN
 	#define SRAM_BANK2_WAITRD	FAST_SRAM_16BITS_WAITRD
 	#define SRAM_BANK2_WAITPAGE	FAST_SRAM_16BITS_WAITPAGE
 	#define SRAM_BANK2_WAITWR	FAST_SRAM_16BITS_WAITWR
	#define SRAM_BANK2_WAITTURN	FAST_SRAM_16BITS_WAITTURN		

#elif (SRAM_BANK2_USE == SRAM_BANK_USE_FAST_SRAM_32BITS)
  	#define SRAM_BANK2_CFG		FAST_SRAM_32BITS_CFG
  	#define SRAM_BANK2_WAITWEN	FAST_SRAM_32BITS_WAITWEN
 	#define SRAM_BANK2_WAITOEN	FAST_SRAM_32BITS_WAITOEN
 	#define SRAM_BANK2_WAITRD	FAST_SRAM_32BITS_WAITRD
 	#define SRAM_BANK2_WAITPAGE	FAST_SRAM_32BITS_WAITPAGE
 	#define SRAM_BANK2_WAITWR	FAST_SRAM_32BITS_WAITWR
	#define SRAM_BANK2_WAITTURN	FAST_SRAM_32BITS_WAITTURN		

#elif (SRAM_BANK2_USE == SRAM_BANK_USE_CHIPSET)
  	#define SRAM_BANK2_CFG		CHIPSET_16BITS_CFG
  	#define SRAM_BANK2_WAITWEN	CHIPSET_16BITS_WAITWEN
 	#define SRAM_BANK2_WAITOEN	CHIPSET_16BITS_WAITOEN
 	#define SRAM_BANK2_WAITRD	CHIPSET_16BITS_WAITRD
 	#define SRAM_BANK2_WAITPAGE	CHIPSET_16BITS_WAITPAGE
 	#define SRAM_BANK2_WAITWR	CHIPSET_16BITS_WAITWR
	#define SRAM_BANK2_WAITTURN	CHIPSET_16BITS_WAITTURN		

#elif (SRAM_BANK2_USE != SRAM_BANK_USE_NONE)
	#error NÃO FOI DEFINIDO O TIPO DE ACESSO A MEMÓRIA ESTÁTICA EXTERNA PARA O BANCO 2
#endif

// CONFIGURAÇÃO DO BANCO 3 (CS3) Endereço entre 0x9c000000 - 0x9fffffff
#if (SRAM_BANK3_USE == SRAM_BANK_USE_COMPACT_FLASH_IDE)
  	#define SRAM_BANK3_CFG		COMPACT_FLASH_IDE_CFG
  	#define SRAM_BANK3_WAITWEN	COMPACT_FLASH_IDE_WAITWEN
 	#define SRAM_BANK3_WAITOEN	COMPACT_FLASH_IDE_WAITOEN
 	#define SRAM_BANK3_WAITRD	COMPACT_FLASH_IDE_WAITRD
 	#define SRAM_BANK3_WAITPAGE	COMPACT_FLASH_IDE_WAITPAGE
 	#define SRAM_BANK3_WAITWR	COMPACT_FLASH_IDE_WAITWR
	#define SRAM_BANK3_WAITTURN	COMPACT_FLASH_IDE_WAITTURN		

#elif (SRAM_BANK3_USE == SRAM_BANK_USE_DISPO_GENERIC_8BITS)
  	#define SRAM_BANK3_CFG		DISPO_GENERIC_8BITS_CFG
  	#define SRAM_BANK3_WAITWEN	DISPO_GENERIC_8BITS_WAITWEN
 	#define SRAM_BANK3_WAITOEN	DISPO_GENERIC_8BITS_WAITOEN
 	#define SRAM_BANK3_WAITRD	DISPO_GENERIC_8BITS_WAITRD
 	#define SRAM_BANK3_WAITPAGE	DISPO_GENERIC_8BITS_WAITPAGE
 	#define SRAM_BANK3_WAITWR	DISPO_GENERIC_8BITS_WAITWR
	#define SRAM_BANK3_WAITTURN	DISPO_GENERIC_8BITS_WAITTURN		

#elif (SRAM_BANK3_USE == SRAM_BANK_USE_DISPO_GENERIC_16BITS)
  	#define SRAM_BANK3_CFG		DISPO_GENERIC_16BITS_CFG
  	#define SRAM_BANK3_WAITWEN	DISPO_GENERIC_16BITS_WAITWEN
 	#define SRAM_BANK3_WAITOEN	DISPO_GENERIC_16BITS_WAITOEN
 	#define SRAM_BANK3_WAITRD	DISPO_GENERIC_16BITS_WAITRD
 	#define SRAM_BANK3_WAITPAGE	DISPO_GENERIC_16BITS_WAITPAGE
 	#define SRAM_BANK3_WAITWR	DISPO_GENERIC_16BITS_WAITWR
	#define SRAM_BANK3_WAITTURN	DISPO_GENERIC_16BITS_WAITTURN		

#elif (SRAM_BANK3_USE == SRAM_BANK_USE_FAST_SRAM_16BITS)
  	#define SRAM_BANK3_CFG		FAST_SRAM_16BITS_CFG
  	#define SRAM_BANK3_WAITWEN	FAST_SRAM_16BITS_WAITWEN
 	#define SRAM_BANK3_WAITOEN	FAST_SRAM_16BITS_WAITOEN
 	#define SRAM_BANK3_WAITRD	FAST_SRAM_16BITS_WAITRD
 	#define SRAM_BANK3_WAITPAGE	FAST_SRAM_16BITS_WAITPAGE
 	#define SRAM_BANK3_WAITWR	FAST_SRAM_16BITS_WAITWR
	#define SRAM_BANK3_WAITTURN	FAST_SRAM_16BITS_WAITTURN		

#elif (SRAM_BANK3_USE == SRAM_BANK_USE_FAST_SRAM_32BITS)
  	#define SRAM_BANK3_CFG		FAST_SRAM_32BITS_CFG
  	#define SRAM_BANK3_WAITWEN	FAST_SRAM_32BITS_WAITWEN
 	#define SRAM_BANK3_WAITOEN	FAST_SRAM_32BITS_WAITOEN
 	#define SRAM_BANK3_WAITRD	FAST_SRAM_32BITS_WAITRD
 	#define SRAM_BANK3_WAITPAGE	FAST_SRAM_32BITS_WAITPAGE
 	#define SRAM_BANK3_WAITWR	FAST_SRAM_32BITS_WAITWR
	#define SRAM_BANK3_WAITTURN	FAST_SRAM_32BITS_WAITTURN		

#elif (SRAM_BANK3_USE == SRAM_BANK_USE_CHIPSET)
  	#define SRAM_BANK3_CFG		CHIPSET_16BITS_CFG
  	#define SRAM_BANK3_WAITWEN	CHIPSET_16BITS_WAITWEN
 	#define SRAM_BANK3_WAITOEN	CHIPSET_16BITS_WAITOEN
 	#define SRAM_BANK3_WAITRD	CHIPSET_16BITS_WAITRD
 	#define SRAM_BANK3_WAITPAGE	CHIPSET_16BITS_WAITPAGE
 	#define SRAM_BANK3_WAITWR	CHIPSET_16BITS_WAITWR
	#define SRAM_BANK3_WAITTURN	CHIPSET_16BITS_WAITTURN		

#elif (SRAM_BANK3_USE != SRAM_BANK_USE_NONE)
	#error NÃO FOI DEFINIDO O TIPO DE ACESSO A MEMÓRIA ESTÁTICA EXTERNA PARA O BANCO 3
#endif

#endif
